import request from '../utils/request'
const doudianBaseUrl = 'https://fxg.jinritemai.com/'

// 获取优惠券列表
export const getCoupList = (param) => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/coupons/v1/list`,
        method: "get",
        param: {
            _bid: 'ecom_market_shop',
            ...param
        }
    })
}
// 获取优惠券详情
export const getCoupDetail = (id) => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/coupons/v1/shopcoupons/${id}`,
        method: "get",
        param: {
            _bid: 'ecom_market_shop'
        }
    })
}
// 作废优惠券
export const delCoup = (id, data) => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/coupons/v1/shopcoupons/${id}`,
        method: "post",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    })
}

// 获取店铺详情
/**
 * 
 * @returns 获取店铺详情
 */
export const getShopDetail = () => {
    return request({
        baseURL: doudianBaseUrl,
        url: `common/index/index`,
        method: "get",
        param: {
            _bid: 'ecom_market_shop'
        }
    })
}
